package com.sheep.pattern;

import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author wangze
 * @date 2021-01-14 15:52.
 **/
public class StreamTest {

	public static void main(String[] args) {
		Stream<Integer> s1 = Stream.of(1, 2, 3);

		Stream.of(1,2,3).map(Integer::doubleValue).collect(Collectors.toList());

		//10
		//20
		//40
		//80
		//160

		Stream<Integer> s2 = Stream.iterate(10, n -> n*2).limit(5);
		s2.forEach(System.out::println);

	}
}
